//import areaData from '@/components/regionalComponents/city-data/area.js';
//import cityData from '@/components/regionalComponents/city-data/city.js';
//import s from '@/components/regionalComponents/city-data/streets.js';
//import provinceData from '@/components/regionalComponents/city-data/province.js';

import {
	queryRegionTree
} from '@/api/user.js'


const get = function(url, data) {
	console.log("data",data)
	let options = {
		parentId: ''
	}
	if (data) {
		options.parentId = data.regionId
	} else {
		options.parentId = '-1'
	}
	return new Promise((relove,reject)=>{
		queryRegionTree(options).then(res=>{
			const result = res.returnObj
			relove(result);
		})
	})
	// queryRegionTree(options).then((res) => {
	// 	const result = res.returnObj
	// 	return new Promise(function(resolve, reject) {
	// 		console.log("provinceData",result)
	// 		if (url.indexOf('province') > -1) {
	// 			const provinceData = result
	// 			resolve(provinceData);
	// 		}
	// 		if (url.indexOf('city') > -1) {
	// 			const cityData = result
	// 			resolve(cityData);
	// 		}
	// 		if (url.indexOf('area') > -1) {
	// 			const areaData = result
	// 			resolve(areaData);
	// 		}
	// 		if (url.indexOf('streets') > -1) {
	// 			const streetsData = result
	// 			resolve(streetsData);
	// 		}
	// 	});
	// })

}
export default {
	get
}